/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.sql.Date;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import vo.rb_raw_mat_stock;

/**
 *
 * @author Shuhail
 */
public class test_curr_stock {
    
    Session sess=null;
    Transaction tx=null;
    static {
       
    }

    public test_curr_stock() {
         SessionFactory sf=new Configuration().configure().buildSessionFactory();
       
        sess=sf.openSession();
        tx=sess.beginTransaction();
    }
    
    
    public static void main(String[] args) {
        rb_raw_mat_stock stock=new rb_raw_mat_stock();
        stock.setCurrent_stock(1);
        stock.setCurrent_unit_price(123.00);
        stock.setCurrent_value(100.00);
        stock.setLast_updated_date(new java.util.Date());
        stock.setLast_updated_invoice_no("P001");
        stock.setRaw_mat_id("R2");
        System.out.println("HERE----"+new java.util.Date());
        test_curr_stock t=new test_curr_stock();
        t.sess.save(stock);
        t.tx.commit();;
        
        
    }
    
}
